import React from "react";
import { action } from "../Collections";
import { Button, Space } from "antd";

export const PopFooter = (props: {
  onUpdate: () => void;
  onOpen: () => void;
  onAdd: () => void;
  type: action;
}) => {
  return (
    <Space>
      {props.type === "add" ? (
        <Button onClick={props.onAdd} type="primary">
          add
        </Button>
      ) : (
        <>
          <Button onClick={props.onUpdate} type="primary">
            confirm
          </Button>
          <Button onClick={props.onOpen}>open</Button>
        </>
      )}
    </Space>
  );
};
